package org.fisco.bcos.asset.resp;

import java.math.BigInteger;
import java.util.List;

/**
 * 捐赠记录实体类
 */
public class DonationRecord {
    private List<BigInteger> amounts;      // 捐赠金额列表
    private List<BigInteger> timestamps;   // 捐赠时间列表
    private List<String> donors;           // 捐赠者地址列表

    /**
     * 构造函数
     */
    public DonationRecord(List<BigInteger> amounts, List<BigInteger> timestamps, List<String> donors) {
        this.amounts = amounts;
        this.timestamps = timestamps;
        this.donors = donors;
    }

    /**
     * 获取捐赠金额列表
     */
    public List<BigInteger> getAmounts() {
        return amounts;
    }

    /**
     * 设置捐赠金额列表
     */
    public void setAmounts(List<BigInteger> amounts) {
        this.amounts = amounts;
    }

    /**
     * 获取捐赠时间列表
     */
    public List<BigInteger> getTimestamps() {
        return timestamps;
    }

    /**
     * 设置捐赠时间列表
     */
    public void setTimestamps(List<BigInteger> timestamps) {
        this.timestamps = timestamps;
    }

    /**
     * 获取捐赠者地址列表
     */
    public List<String> getDonors() {
        return donors;
    }

    /**
     * 设置捐赠者地址列表
     */
    public void setDonors(List<String> donors) {
        this.donors = donors;
    }

    /**
     * 获取捐赠记录数量
     */
    public int getRecordCount() {
        return amounts != null ? amounts.size() : 0;
    }

    /**
     * 获取指定索引的捐赠记录
     */
    public DonationRecordItem getRecord(int index) {
        if (index < 0 || index >= getRecordCount()) {
            return null;
        }
        return new DonationRecordItem(
                amounts.get(index),
                timestamps.get(index),
                donors.get(index)
        );
    }
}

